<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box {
            width: 100px;
            height: 100px;
            border: 3px solid skyblue;
        }

        .AA {
            background-color: red;
        }
    </style>
</head>

<body>
    <div class="box" style="background-color:blue ">haha123</div>
    <script>
        let box = document.querySelector('.box')
        /*  let AA = box.style
        AA.backgroundColor = 'red' */
        let BB = box.style.backgroundColor
        BB = 'red'
        console.dir(BB);
        // BB = 'red'
    </script>
</body>

</html>